/**
 * 
 */
function myMap() {
	var struct = function(key, value) {
		this.key = key;
		this.value = value;
	}

	var put = function(key, value) {
		for (var i = 0; i < this.arr.length; i++) {
			if (this.arr[i].key === key) {
				this.arr[i].value = value;
				return;
			}
		}
		this.arr[this.arr.length] = new struct(key, value);
	}

	var get = function(key) {
		for (var i = 0; i < this.arr.length; i++) {
			if (this.arr[i].key === key) {
				return this.arr[i].value;
			}
		}
		return null;
	}
	this.arr = new Array();
	this.get = get;
	this.put = put;
}
function getUrlParams() {
	var map = new myMap();
	var query =location.search.substring(1); // Get query string
	var pairs = query.split("&"); // Break at ampersand
	for (var i = 0; i < pairs.length; i++) {
		if (!pairs[i]) {
			continue;
		}
		var pos = pairs[i].split('='); // Look for "name=value"
		map.put(pos[0], pos[1]);
	}
	return map;
}
function gethref(){
	return (window.location.href)
}
function getCookie(){
	var map = new myMap();
//	alert(document.cookie);
    var arr = document.cookie.split("; ");
    for(var i=0,len=arr.length;i<len;i++){
    	if(!arr[i]){
    		continue;
    	}
        var item = arr[i].split("=");
        map.put(item[0],item[1]);
    }
    return map;
}
